package com.more.offer.exercise.cglibproxy;

import net.sf.cglib.core.DebuggingClassWriter;
import net.sf.cglib.proxy.Enhancer;

/**
 * @author pinoc
 * @date 2021/8/9
 * @description
 */
public class CglibMainTest {
	public static void main(String[] args) {
		System.setProperty(DebuggingClassWriter.DEBUG_LOCATION_PROPERTY,
				"E:\\project_cache\\Code\\target\\classes");
		Enhancer enhancer = new Enhancer();
		enhancer.setSuperclass(MyServiceImpl.class);
		enhancer.setCallback(new MyMethodInterceptor());
		MyServiceImpl o = (MyServiceImpl) enhancer.create();
		o.doSomeThing();
		o.doSay();
	}
}
